package com.squapsource.project_euler;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.Arrays;
import java.util.List;

import org.apache.commons.io.FileUtils;

public class Problem13 {

	/**
	 * @param args
	 * @throws URISyntaxException
	 * @throws IOException
	 */
	public static void main(String[] args) throws URISyntaxException,
			IOException {
		File file = new File(Problem13.class.getResource("/Problem13.txt")
				.toURI());

		List<String> numStrings = Arrays.asList(FileUtils.readFileToString(file).split("\n"));
		long sum =0;
		for (String numString : numStrings)
		{
			long parsedNum = Long.parseLong(numString.substring(0, 11));
			sum += parsedNum;
		}
		
		System.out.println(Long.toString(sum).substring(0,10));

	}

}
